package cn.jinzhu.springcloud1;

import cn.jinzhu.springcloud.CloudConsumerOrder80;
import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.RandomRule;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
 //ribbonClient负载均衡替换  轮询 重试 随机 等   //不能再@SpringBootApplication 本包和子包下配置，重新建立一个，在放入启动类里面
public class MyselRefult {

    @Bean
    public IRule iRule(){
        return  new RandomRule(); //负载均衡策略  随机
    }

}
